package com.demo.spring.cloud.producer.contoller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangzhilong
 * @date 2019-06-14
 */
@RestController
public class HelloController {


    @RequestMapping("/hello")
    public String index() {
        return "hello world smile!";
    }
    @RequestMapping("/V2/hello")
    public String index2() {
        return "hello world V2!";
    }

    @RequestMapping("/foo")
    public String foo(String foo) {
        try {
            System.out.println("foo param:" +foo);
            Thread.sleep((int)(Math.random() * 10));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello "+foo+"!";
    }



}
